﻿@model IList<Qu.SeniorProject.Model.StudetGradeDetail>

<h2>Grading Details</h2>
<table>

       @{
           string previousCategoryDescription = string.Empty;
           string previousExaminer = string.Empty;
           string overallComment = string.Empty;
       }
       @foreach (Qu.SeniorProject.Model.StudetGradeDetail evaluationDetail in Model)
       {
           //Show the Examiner Row
           if (previousExaminer != evaluationDetail.Examiner)
           {
                 if (previousExaminer != string.Empty && overallComment != string.Empty)
                 {
                    <tr>
                        <td colspan="3">
                            <strong>Overall comments:</strong> <br /> @Html.Raw(overallComment)
                        </td>
                    </tr>
                 }
                 <tr>
                    <td colspan="3" class="col1" style="font-weight: bold; color: #800000;">
                        <div class='category'>@evaluationDetail.Examiner
                        </div>
                    </td>
                </tr>
           }
           previousExaminer = evaluationDetail.Examiner;
           overallComment = evaluationDetail.OverallComments;

           //Show the Category Row
           if (previousCategoryDescription != evaluationDetail.CategoryDescription)
           {
             <tr>
                <td colspan="3" class="col1" style="font-weight: bold; color: #0066CC;">
                    <div class='category'>@evaluationDetail.CategoryDisplayOrder. @evaluationDetail.CategoryDescription
                    </div>
                </td>
            </tr>
           }
           previousCategoryDescription = evaluationDetail.CategoryDescription;

                <tr>
                    <td class="col1" >
                       <text>
                            <div class='criteriaTitle'>
                                @evaluationDetail.CriteriaTitle 
                                @*<strong><small>(out of @((int)evaluationDetail.Grade))</small></strong>*@
                             </div>
                                @Html.Raw(evaluationDetail.CriteriaDescription)
                        </text>
                    </td>
                    <td class="col2" valign='top' >
                        @evaluationDetail.Rating
                    </td>
                    <td class="col3" align='justify'>
                         @Html.Raw(evaluationDetail.Comments)
                    </td>
                </tr>
       }

       @if (overallComment != string.Empty)
       {
           <tr>
                <td colspan="3">
                   <strong>Overall comments:</strong> <br /> @Html.Raw(overallComment)
                </td>
            </tr>
       }
    </table>

    <title>GradeDetails</title>
</head>
<body>
    <div>
        
    </div>
</body>
</html>
